﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Site.Models.ClanDetail>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="account_header">
    <table>
        <tr>
            <td><img src='<%= Html.DisplayFor(model => model.clan.CLAN_LOGOURL) %>' /></td>
            <td><h2>Page du clan <%: Html.DisplayFor(model => model.clan.CLAN_NAME)%></h2></td>
        </tr>
    </table>
</div>

<fieldset>
    <legend>Détails du clan</legend>
        <table>
            <tr>
                <td>Nom du clan</td>
                <td><%: Html.DisplayFor(model => model.clan.CLAN_NAME) %></td>
            </tr>
            <tr>
                <td>Description du clan</td>
                <td><%: Html.DisplayFor(model => model.clan.CLAN_DESCRIPTION) %></td>
            </tr>
            <% if (Model.clan.CLAN_FORUMLINK != null || Model.clan.CLAN_FORUMLINK != "")
               { %>
            <tr>
                <td><a href="<%: Html.DisplayFor(model => model.clan.CLAN_FORUMLINK)%>">Aller au forum</a></td>
            </tr>
            <% } %>
        </table>
        
</fieldset>
<p>

    <%: Html.ActionLink("Editer le clan", "Edit", new { id=Model.clan.CLAN_ID }) %> |
    <%: Html.ActionLink("Supprimer le clan", "Delete", new { id=Model.clan.CLAN_ID }) %> |
    
    <% if (Session.Contents["userClanId"] == null || Session.Contents["userClanId"] == "")
       { %>
    <%: Html.ActionLink("Rejoindre le clan", "Join", new { id = Model.clan.CLAN_ID })%>
    <% } else { %>
    <%: Html.ActionLink("Quitter le clan", "Quit", new { id = Model.clan.CLAN_ID })%>
    <% } %>
    |
    <%: Html.ActionLink("Retour à la liste", "Index") %> 
</p>

<fieldset>
    <legend>Statistiques du clan : </legend>
    
    <table>
        <tr>
            <td>Classement</td>
            <td><%: Html.DisplayFor(model => model.stats[0].STAT_RANK)%></td>
        </tr>
        <tr>
            <td>Total de parties gagnées</td>
            <td><%: Html.DisplayFor(model => model.stats[0].STAT_WONGAMES)%></td>
        </tr>
        <tr>
            <td>Total de parties perdues</td>
            <td><%: Html.DisplayFor(model => model.stats[0].STAT_LOSTGAMES)%></td>
        </tr>
        <tr>
            <td>Total de parties abandonnées</td>
            <td><%: Html.DisplayFor(model => model.stats[0].STAT_ABANDONEDGAMES)%></td>
        </tr>
    </table>
</fieldset>

<fieldset>
    <legend>Membres du clan : </legend>
    
    <table>
        <tr>
            <!--<td></td>-->
            <td>Nom</td>
            <td>Nombre de vitoires</td>
            <td>Nombre de défaites</td>
            <td>Nombre d'abandons</td>
        </tr>
        <% foreach (var item in Model.users) { %>
            <tr>
                <!--<td><%: Html.DisplayFor(modelItem => item.stats.STAT_RANK)%></td>-->
                <td><%: Html.ActionLink(item.user.UserName, "Details", "Account", new { id = item.user.UserId }, null)%></td>
                <td><%: Html.DisplayFor(modelItem => item.stats.STAT_WONGAMES)%></td>
                <td><%: Html.DisplayFor(modelItem => item.stats.STAT_LOSTGAMES)%></td>
                <td><%: Html.DisplayFor(modelItem => item.stats.STAT_ABANDONEDGAMES)%></td>
                
                <!--<td>
                    <form>
                    <select name="role">
                        <% foreach (var option in Model.roles) { %>
                            <option>
                                <%: Html.DisplayFor(modelItem => option.RoleName)%>
                            </option>
                        <% } %>
                    </select>
                    </form>
                </td>-->
            </tr>
        <% } %>
    </table>
</fieldset>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="alerts" runat="server">
</asp:Content>
